Propagate iteration to parent in OffsetArrays#257
Propagate iteration to parent in OffsetArrays#257jishnub merged 2 commits intoJuliaArrays:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #257 +/- ##
==========================================
+ Coverage 95.41% 95.43% +0.02%
==========================================
Files 5 5
Lines 436 438 +2
==========================================
+ Hits 416 418 +2
Misses 20 20
Continue to review full report at Codecov.
|
|
It really would be nice not to have to specialize so many things on OffsetArray. The more methods we have, the less generic we are. #255 (comment) seems like it needs a decision before we do things like this. |
|
This is unrelated to bounds-checking though, and may be addressed independent of #255. This seems to be a necessary addition at least for ranges, and may be version-limited if |
|
My point is that it's better to address these by private methods or traits; we don't want to overload every exported function in Base specifically for OffsetArrays, that would be a nightmare. As much as possible, we should give them the generic interface and then let the generic implementations handle them. I recognize that may not always be possible, but that should be the goal. |
|
Another approach: what is the specific source of the poor performance on master? Can we fix it there instead? |
|
That might be possible using a trait-based approach similar to #255. Perhaps the source of this difference, at least for |
timholy
left a comment
There was a problem hiding this comment.
In light of JuliaLang/julia#41968 (review), I'm changing my recommendation here.
Sorry it took me a while to get to this. I was consumed by JuliaLang/julia#42016, which if it's not entirely misguided (:question:) should be a very impactful change for the whole ecosystem.
This provides a performance boost, especially for range indices but also to some extent for array indices.
On master
After this PR
It's interesting that an
OffsetArray(::StepRange)index leads to faster indexing than with aStepRangeindex (although the difference appears smaller on nightly).